# encoding=utf-8
# author:梁子龙
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from config import settings


def init_cors(app: FastAPI) -> None:
    app.add_middleware(CORSMiddleware,
                       allow_origins=settings.ORIGINS,
                       allow_credentials=True,
                       allow_method=["*"],
                       allow_headers=["*"],

                       )
